import { createRouter, createWebHistory } from 'vue-router'

//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'

import HomeVue from '@/views/home/Home.vue'
import MechaCardVue from '@/views/mecha/MechaCard.vue'
import MechaDetailVue from '@/views/mecha/MechaDetail.vue'
import DriverCardVue from '@/views/driver/DriverCard.vue'
import DriverDetailVue from '@/views/driver/DriverDetail.vue'
// import UserAvatarVue from '@/views/user/UserAvatar.vue'
// import UserInfoVue from '@/views/user/UserInfo.vue'
// import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'
import BcsetVue from '@/views/bc/Bcset.vue'

import AIVue from '@/views/bc/data/set/AI.vue'

import AnjianVue from '@/views/bc/data/organize/Anjian.vue'
import BaihuaVue from '@/views/bc/data/organize/Baihua.vue'
import ChuanVue from '@/views/bc/data/organize/Chuan.vue'
import FeilanteVue from '@/views/bc/data/organize/Feilante.vue'
import KanpanaVue from '@/views/bc/data/organize/Kanpana.vue'
import KesuoerVue from '@/views/bc/data/organize/Kesuoer.vue'
import ShizixingVue from '@/views/bc/data/organize/Shizixing.vue'
import XinxiwangVue from '@/views/bc/data/organize/Xinxiwang.vue'
import XinyidianVue from '@/views/bc/data/organize/Xinyidian.vue'
import XinzhengfuVue from '@/views/bc/data/organize/Xinzhengfu.vue'
import YinxiuhuiVue from '@/views/bc/data/organize/Yinxiuhui.vue'

import AlphaVue from '@/views/bc/data/event/Alpha.vue'
import SparkVue from '@/views/bc/data/event/Spark.vue'
import WarVue from '@/views/bc/data/event/War.vue'

import RoleVue from '@/views/bc/data/role/Role.vue'

import RelateVue from '@/views/bc/data/relate/Relate.vue'

import TimeVue from '@/views/bc/data/time/Time.vue'


import UserUpdateVue from '@/views/user/UserUpdate.vue'
import EditionVue from '@/views/edition/Edition.vue'
import AuthorVue from '@/views/author/Author.vue'
import ThankVue from '@/views/thank/Thank.vue'

//定义路由关系
const routes = [
    { path: '/login', component: LoginVue },
    {
        path: '/', component: LayoutVue, redirect: '/home', children: [
            { path: '/home', component: HomeVue },
            { path: '/mecha/:sortId?', component: MechaCardVue },
            { path: '/mecha/detail/:mechaId?', component: MechaDetailVue },
            { path: '/driver', component: DriverCardVue },
            { path: '/driver/detail/:id?', component: DriverDetailVue },

            { path: '/bc', component: BcsetVue },

            { path: '/ai', name: 'ai', component: AIVue },

            { path: '/anjian', name: 'Anjian', component: AnjianVue },
            { path: '/baihua', component: BaihuaVue },
            { path: '/chuan', component: ChuanVue },
            { path: '/feilante', component: FeilanteVue },
            { path: '/kanpana', component: KanpanaVue },
            { path: '/kesuoer', component: KesuoerVue },
            { path: '/shizixing', component: ShizixingVue },
            { path: '/xinxiwang', component: XinxiwangVue },
            { path: '/xinyidian', component: XinyidianVue },
            { path: '/xinzhengfu', component: XinzhengfuVue },
            { path: '/yinxiuhui', component: YinxiuhuiVue },

            { path: '/alpha', component: AlphaVue },
            { path: '/spark', component: SparkVue },
            { path: '/war', component: WarVue },

            { path: '/role', component: RoleVue },

            { path: '/relate', component: RelateVue },

            { path: '/time', component: TimeVue },

            { path: '/user/update', component: UserUpdateVue },
            { path: '/user/edition', component: EditionVue },
            { path: '/user/author', component: AuthorVue },
            { path: '/user/thank', component: ThankVue }
        ]
    }
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router